package com.miya.demo.controller;

import com.miya.demo.model.base.BaseResponse;
import com.miya.demo.model.dto.system.MenuAddDTO;
import com.miya.demo.service.MenuService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 菜单控制器
 *
 * @author Caixiaowei
 * @date 2022/08/18
 */
@RestController
@RequestMapping("/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    @ApiOperation(value = "新增资源")
    @PostMapping("/add")
    public BaseResponse add(@RequestBody MenuAddDTO menuAddDTO) {
        menuService.add(menuAddDTO);
        return BaseResponse.create();
    }
}
